AMD IOMMU: add mechanism to protect their PCI devices' config spaces
authorJan Beulich <jbeulich@suse.com>
Fri, 22 Jun 2012 11:43:00 +0000 (13:43 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 22 Jun 2012 11:43:00 +0000 (13:43 +0200)
commit56b3130c1a4ffc3c1a045559240261b892b9b880
treecfa39d69fc251380e7358e1230c3a1c3c654cf0a
parent7f15d8540d2ea880170194700a8fb4600da8643b
AMD IOMMU: add mechanism to protect their PCI devices' config spaces

Recent Dom0 kernels want to disable PCI MSI on all devices, yet doing
so on AMD IOMMUs (which get represented by a PCI device) disables part
of the functionality set up by the hypervisor.

Add a mechanism to mark certain PCI devices as having write protected
config spaces (both through port based [method 1] accesses and, for
x86-64, mmconfig), and use that for AMD's IOMMUs.

Note that due to ptwr_do_page_fault() being run first, there'll be a
MEM_LOG() issued for each such mmconfig based write attempt. If that's
undesirable, the order of the calls in fixup_page_fault() would need
to be swapped.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Wei Wang <wei.wang2@amd.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/arch/x86/mm.c
xen/arch/x86/traps.c
xen/arch/x86/x86_32/pci.c
xen/arch/x86/x86_64/mmconfig_64.c
xen/drivers/passthrough/amd/iommu_detect.c
xen/drivers/passthrough/io.c
xen/drivers/passthrough/pci.c
xen/include/asm-x86/mm.h
xen/include/xen/pci.h